/*
 * @Author: your name
 * @Date: 2021-07-13 14:59:33
 * @LastEditTime: 2021-07-14 14:12:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \usp-osm-frondend\src\api\category.js
 */
import { service } from '@/utils/request'

const api = {
  categoryList: '/admin/mdse/category/getChildren/',
  categoryDetail: '/admin/mdse/category/get/',
  categoryUpdate: '/admin/mdse/category/saveOrUpdate',
  categoryDelete: '/admin/mdse/category/delete/'
}

export function getList (parentId) {
  return service({
    url: api.categoryList + parentId,
    method: 'get'
  })
}

export function categoryDetail (id) {
  return service({
    url: api.categoryDetail + id,
    method: 'get'
  })
}

export function categoryUpdate (data) {
  return service({
    url: api.categoryUpdate,
    method: 'post',
    data
  })
}

export function categoryDelete (id) {
  return service({
    url: api.categoryDelete + id,
    method: 'get'
  })
}
